package cn.tedu;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo01 {
    public static void main(String[] args) {
    //获取连接
        try(Connection conn=DBUtils.getConn()) {
        String sql="create table hero(id int primary " +
                "key auto_increment,name varchar(20),money int)";
        //创建执行SQL语句的对象
            Statement s=conn.createStatement();
            //执行创建表的SQL语句
            s.execute(sql);
            System.out.println("创建完成!");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }

    }
}
